<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWechatProgramsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_programs', function (Blueprint $table) {
            $table->increments('id');
            $table->longText('component_verify_ticket')->nullable()->comment('验证票据');
            $table->string('component_verify_ticket_status')->nullable()->comment('状态：3错误码;2更新;1未更新');
            $table->string('component_access_token')->nullable()->comment('开放平台令牌');
            $table->integer('component_access_token_time')->nullable()->comment('开放平台令牌有效期:2小时');
            $table->string('pre_auth_code')->nullable()->comment('预授权码');
            $table->integer('pre_auth_code_time')->nullable()->comment('预授权码有效期:10分钟');
            $table->nullableTimestamps();
        });
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechat_programs');
    }
}
